<template>
	<view class="user-tongji">
		<div class="tobg">
			<image src="/static/img/agent/addbg.png" mode=""></image>
		</div>
		<div class="tongji-info">
			<uni-table style="width: 100%;" :loading="loading" emptyText="暂无更多数据">
				<uni-tr>
					<uni-th align="center">设备编号</uni-th>
					<uni-th align="center">笔数</uni-th>
					<uni-th align="center">合计收入</uni-th>
				</uni-tr>
				<uni-tr v-for="(item, index) in tableData" :key="index">
					<uni-td>{{ item.code }}</uni-td>
					<uni-td align="center">{{ item.count_sum }}</uni-td>
					<uni-td align="center">{{ item.pay_money_sum }}</uni-td>
				</uni-tr>
			</uni-table>
		</div>
	</view>
</template>

<script>
	import { getVenueOne } from '../../api/api.js'
	export default {
		data() {
			return {
				loading: false,
				tableData: []
			}
		},
		onLoad(option) {
			this.getStatisticDetail(option.id);
		},
		methods: {
			getStatisticDetail(id) {
				getVenueOne({
					venues_id: id
				}).then(res => {
					console.log(res, 'resseeeess');
					if(res.code === 1) {
						this.tableData = res.data;
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.user-tongji {
	width: 100%;
	height: 100%;
	background: #F7F7F7;
	.tobg{
		width: 100%;
		height: 204px;
		image{
			width: 100%;
			height: 100%;
		}
	}
	.tongji-info{
		width: 85%;
		background: url('../../static/img/agent/ygbg.png') no-repeat center;
		background-size: 100% 100%;
		position: absolute;
		top: 20px;
		left: calc((15% - 52px) / 2);
		padding: 26px;
		.info-item{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding-bottom: 15px;
			padding-top: 10px;
			border-bottom: 1px solid #D3EBFF;
			p{
				font-weight: 400;
				font-size: 14px;
				color: #737373;
			}
			span{
				font-weight: 400;
				font-size: 14px;
				color: #000000;
			}
		}
	}
}
::v-deep .uni-table {
	min-width: 0 !important;
}
</style>
